/* 由于字典值都是从字典接口获取，实际场景还是很多地方写死值判断， 为防止后续改动，字典值的判断统一写在此文件 */

type dictKeyType = string | number;

/** 结算方式  settlement */
// 月结
export const isMonthSettlement = (settlement: dictKeyType) => String(settlement) === '1';
// 票结
export const isTicketSettlement = (settlement: dictKeyType) => String(settlement) === '2';

/** 客户类型 */
// 客户是否是否是个人
export const companyIsPersonal = (type: string | number) => String(type) === '2';

/** 客户合作状态 cooperationStatus */
// 待合作
export const isCooperationTodo = (cooperationStatus: dictKeyType) => String(cooperationStatus) === '0';
// 合作中
export const isCooperationDone = (cooperationStatus: dictKeyType) => String(cooperationStatus) === '1';
// 取消合作
export const isCooperationCancel = (cooperationStatus: dictKeyType) => String(cooperationStatus) === '2';

/** 线索客户状态 */
//  待认领
export const isClueStatusTodo = (clueStatus: dictKeyType) => String(clueStatus) === '0';
// 已认领
export const isClueStatusDone = (clueStatus: dictKeyType) => String(clueStatus) === '1';

/** 地址类型 */
// fba 和 沃尔玛
export const isFba = (destType: dictKeyType) => String(destType) === '1' || String(destType) === '2';
// 邮编
export const isPostCode = (destType: dictKeyType) => String(destType) === '3';
// 海外仓
export const isOverWarehouse = (destType: dictKeyType) => String(destType) === '4';

/** 派送方式 */
// ups
export const isUps = (deliveryMethod: dictKeyType) => String(deliveryMethod)?.toLocaleLowerCase() === 'ups';

/** 报价方式 */
// 按整柜报价
export const isBoxPrice = (billMethod: dictKeyType) => String(billMethod) === 'CABINET';
export const isKgsPrice = (billMethod: dictKeyType) => String(billMethod) === 'KGS';
export const isCbmPrice = (billMethod: dictKeyType) => String(billMethod) === 'CBM';

/** 报关方式 */
// 买单报关
export const isMdBg = (bgMethod: dictKeyType) => String(bgMethod) === '1';
export const isTsBg = (bgMethod: dictKeyType) => String(bgMethod) === '2';

/** 保险 insuranceFlag */
// 买保险
export const isinsuranceFlag = (insuranceFlag: dictKeyType) => String(insuranceFlag) === '1';

/** 税金 taxFlag */
// 包税
export const isTaxFlag = (taxFlag: dictKeyType) => String(taxFlag) === '1';

/** 交货方式 */
// 上门提货
export const takePickUp = (pickUpMethod: dictKeyType) => String(pickUpMethod) === '1';
export const takeToWarese = (pickUpMethod: dictKeyType) => String(pickUpMethod) === '2';

/** 计费方式 */
export const isCbm = (paymethod: dictKeyType) => String(paymethod) === 'CBM';
export const isKgc = (paymethod: dictKeyType) => String(paymethod) === 'KGS';
export const isCabinet = (paymethod: dictKeyType) => String(paymethod) === 'CABINET';

/** 意向单 */
// 

/** 拼箱方式 */
export const isMixGroupType = (groupType: dictKeyType) => String(groupType) === '1';

/** 装柜类型 */
export const isTogether = (cabinetType: dictKeyType) => String(cabinetType) === '2' 